<%@ page language="java" contentType="text/html; charset=UTF-8"
     pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core"  prefix="c" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html>
<html>

<body>
	<script type="text/javascript">
	
	function saveProject2() {
		$('#fm').form('submit',{  
	        url: 'updateProjectNode',  
	        onSubmit: function(){ 
	        	
	            return $(this).form('validate');  
	        },  
	        success: function(result){  
	        	alert('ok.请刷新，暂时的。');
	        }  
	    });  
	}
	</script>
                <jsp:useBean id="now" class="java.util.Date" />   
                <c:set var="current" value="${ (1900 + now.year) * 100 + now.month + 1 }"/>
				<div class="ftitle">Project Node Information</div>
				<form id="fm" method="post">
					
					<input name="id" type="hidden" value="${project.id}" />
					
					<div class="fitem">
					    <label for="flowId">Flow Id:</label> 
					    <input value="${project.flowId}" data-options="url:'getAllFlow', valueField:'id', disabled:'true', textField:'name', panelHeight:'auto'" id="slectFlowId" class="easyui-combobox" name="flowId" />        
					</div>
				
					<div class="fitem">
						<label>Project ID:</label> 
						<input name="projectId" class="easyui-validatebox" readonly value="${project.projectId}" required="true">
					</div>
					<div class="fitem">
						<label>Project Name:</label> 
						<input name="name" class="easyui-validatebox" readonly value="${project.name}"  required="true">
					</div>
					<div class="fitem">
						<label>Version:</label> 
						<input name="version" class="easyui-validatebox" readonly value="${project.version}" required="true">
					</div>
					<div class="fitem">
						<label>Start Time</label> 
						<input name="startTime" type="text" readonly data-options="disabled:'true'" value="${project.startTime}"  class="easyui-datetimebox" required style="width:150px">  
					</div>
					<div class="fitem">
						<label>End Time</label> 
						<input name="endTime" type="text" readonly data-options="disabled:'true'" class="easyui-datetimebox" value="${project.endTime}" required style="width:150px">  
					</div>
					
					<div class="fitem">
						<label>Comment</label> 
						<textarea name="comment" readonly cols="50" rows="3">${project.comment}</textarea>  
					</div>
					 
				

                    <c:forEach var="item" items="${project.nodeList}" varStatus="status"> 

						<fieldset class="dynamic"> 
							<legend> ${item.nodeName} </legend>
							<input name="nodeList[${status.index}].id" type='hidden' value='${item.id}'/> 
							
							
							<div class='fitem'> 
								<label>Project Node Status:</label> 
								<input name='nodeList[${status.index}].status' class='easyui-validatebox' required='true' readonly value='${item.status}'/>
							</div>
							
							<div class='fitem'> 
								<label>Project Node Plan WorkLoad:</label> 
								<input name='nodeList[${status.index}].planWorkLoad' class='easyui-validatebox' readonly required='true' value='${item.planWorkLoad}'/>
							</div>
							<div class='fitem'> 
								<label>Project Node Actual WorkLoad:</label> 
								<input name='nodeList[${status.index}].actWorkLoad' class='easyui-validatebox' required='true' value='${item.actWorkLoad}'/>
							</div>
							
							
							
							<c:forEach var="workload" items="${item.workLoadRecord}" varStatus="workStatus">
								<c:set var="key" value="${ workload.key }"/>
								<c:set var="value" value="${ workload.value }"/>r
								
							  
									<label>${ key / 100 }</label>
									<input name="nodeList[${status.index}].workLoadRecord[${ key }]" type="text" readonly value="${ value }"   style="width:50px">  
							 
							    
							</c:forEach>
							
							<div class='fitem'> 
								<label>Current Month WorkLoad:</label> 
								<input name='nodeList[${status.index}].curWorkLoad' class='easyui-validatebox'  value='${item.curWorkLoad}'/>
							</div>
							
							<div class='fitem'> 
								<label>Proxy User Id:</label> 
								<input name='nodeList[${status.index}].proxyUserId' value='0' data-options="url:'getAllUser', valueField:'userID',  textField:'userName', method: 'GET'" class='easyui-combobox'/> 
							</div>
							
							
						</fieldset>
						
					</c:forEach> 
					
					

				</form>
			
				<div id="dlg-buttons">
					<a href="#" class="easyui-linkbutton" iconCls="icon-ok" onclick="saveProject2()">Save</a> 
		    	</div>
		    
	

</body>
</html>

